﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NB.MGJ.Common.OSS
{
    public interface IOssManager
    {
        /// <summary>
        /// 上传文件流
        /// </summary>
        /// <param name="key">文件名</param>
        /// <param name="stream">文件流</param>
        /// <returns></returns>
        bool PutObject(string key, Stream stream);

        /// <summary>
        /// 删除Object
        /// </summary>
        /// <param name="key">文件名</param>
        void DeleteObject(string key);

        /// <summary>
        /// 获取Obj
        /// </summary>
        /// <param name="key">文件名</param>
        /// <returns></returns>
        Stream GetObj(string key);


        /// <summary>
        /// 获取文件访问Url
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        string GetUrl(string key);
    }

}
